Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 20 - QuickDraw 3D Mathematical Utilities / QuickDraw 3D Mathematical Utilities Reference
QuickDraw 3D Mathematical Utilities / Managing Quaternions


Q3Quaternion_SetRotateVectorToVector

You can use the Q3Quaternion_SetRotateVectorToVector function to configure a quaternion that rotates objects around the origin in such a way that a transformed vector matches a given vector.

TQ3Quaternion *Q3Quaternion_SetRotateVectorToVector (
TQ3Quaternion *quaternion, 
const TQ3Vector3D *v1, 
const TQ3Vector3D *v2);
quaternion
A quaternion.
v1
A three-dimensional vector.
v2
A three-dimensional vector.
DESCRIPTION
The Q3Quaternion_SetRotateVectorToVector function returns, as its function result and in the quaternion parameter, a quaternion that rotates objects around the origin in such a way that the transformed vector v1 matches the vector v2. Both v1 and v2 should be normalized.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996